#include <stdio.h>
#include <stdlib.h>
#include "linkstack.h"

void  change(int number,linkstack_t **top){
    while(number/2){
        PushLinkStack(top,number%2);
        number/=2;
    }
    PushLinkStack(top,number%2);
}

void myprint(linkstack_t* top){
    linkstack_t*p=top;
    while(p != NULL){
        printf("%d ",GetTopLinkStack(p));
        p=p->next;
    }
    printf("\n");
}


int main() {
    linkstack_t *top=NULL;
    CreateEpLinkStack(&top);
    int number=0;
    printf("请输入数: \n");
    scanf("%d",&number);
    change(number,&top);
    myprint(top);

    return 0;
}
